# Maintainer: David Runge <dave@sleepmap.de>

pkgname=freeverb3
pkgver=3.2.1
pkgrel=4
pkgdesc="A signal processing library"
arch=('loong64' 'x86_64')
url="http://www.nongnu.org/freeverb3"
license=('GPL2')
depends=('fftw')
makedepends=('audacious' 'chrpath' 'gtk3' 'jack' )
optdepends=('jack: for standalone applications'
            'gtk3: for audacious plugin')
provides=('libfreeverb3.so')
source=("http://download.savannah.nongnu.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.xz"{,.sig})
sha512sums=('7cab3b2389c8d0a60d0c5f809b214677221204727a74a2b8622455b579aa8fcbd6952da3a343d0ff4bd06a386bbaed0371ddac99bb8ee85862b62435eaeba21b'
            'SKIP')
validpgpkeys=('B8D53D449927D201E96A6EB28B9A2924D2EB674E') # Teru Kamogashira <tkamogashira-tky@umin.net>

prepare() {
  cd "$pkgname-$pkgver"
  # fix issue with pkg-config file pointing to wrong include directory
  sed -e 's/libfreeverb3-2/libfreeverb3-3/' \
      -i freeverb3-3.pc.in
  autoreconf -vfi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr \
              --enable-jack
  make
}

check() {
  cd "$pkgname-$pkgver"
  make -k check
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
  # remove dangling RPATHs
  chrpath -d "${pkgdir}/usr/bin/fv3"*
  install -vDm 644 {AUTHORS,ChangeLog*,README} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim:set ts=2 sw=2 et:
